#include "hd_draw.h"

HD_Draw::HD_Draw()
{
    //ctor
}

HD_Draw::~HD_Draw()
{
    //dtor
}

void HD_Draw::Demo()
{
    const char* fileimage = "D:\\testdata\\image.jpg";
    Mat image = imread(fileimage);
    //HD_Draw::drawLine(image);
    //HD_Draw::drawRectangle(image);
    HD_Draw::drawCircle(image);
}

void HD_Draw::drawLine(Mat image)
{
    Point lineFrom = Point(10, 10);
    Point lineTo = Point(10, 100);

    line(image, lineFrom, lineTo, Scalar(0, 0, 255), 1, 8, 0);

    imshow("result", image);
    printData(dropImage(image, 0, 0, 25, 25));

    waitKey();
}

void HD_Draw::drawRectangle(Mat image)
{
    Point lineFrom = Point(10, 10);
    Point lineTo = Point(100, 100);

    rectangle(image, lineFrom, lineTo, Scalar(0, 0, 255), 1, 8, 0);

    imshow("result", image);
    printData(dropImage(image, 0, 0, 25, 25));

    waitKey();
}

void HD_Draw::drawCircle(Mat image)
{
    Point center = Point(100, 100);
    int radius= 100;

    circle(image, center, radius, Scalar(0, 0, 255), 1, 8, 0);

    imshow("result", image);
    printData(dropImage(image, 0, 100, 25, 25));

    waitKey();
}
